<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>



<!-- TYPEAHEAD -->
<link rel="stylesheet" type="text/css" href="js/typeahead/typeahead.css" />
<!-- FILE UPLOAD -->
<link rel="stylesheet" type="text/css"
	href="js/bootstrap-fileupload/bootstrap-fileupload.min.css" />
<!-- SELECT2 -->
<link rel="stylesheet" type="text/css" href="js/select2/select2.min.css" />
<!-- UNIFORM -->
<link rel="stylesheet" type="text/css"
	href="js/uniform/css/uniform.default.min.css" />
<!-- JQUERY UPLOAD -->
<!-- blueimp Gallery styles -->
<link rel="stylesheet" href="js/blueimp/gallery/blueimp-gallery.min.css">
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="js/jquery-upload/css/jquery.fileupload.css">
<link rel="stylesheet"
	href="js/jquery-upload/css/jquery.fileupload-ui.css">
<script src="js/jquery/jquery-2.0.3.min.js"></script>
<style type="text/css">
			table {
				border-collapse: collapse;
				text-align: center;
			}
			
			td {
				width: 100px;
				height: 40px;
				border: 2px solid #000;
			}
			
			tr:first-child td {
				border: none;
			}
     </style>




<div id="main-content">

	<div class="container">
		<div class="row">
			<div id="content" class="col-lg-12">
				
				  <!-- FORMS -->
				<div class="row ">
					<div class="col-md-12">

						<div class="col-md-12">
							<!-- BASIC -->
							
								
								<div class="box-body big">
									<form class="form-horizontal" role="form" action="./insertIntermediary"
										method="post">
										<div style="margin-right: 100px;">
										
											<table cellspacing="0" style="width: 100%;margin-left: 6%;">
												<tr>
													<td colspan="4"><h2>
															<b>中介机构服务单位选定表</b>
														</h2></td>
												</tr>
												<tr>
													<td style="width: 27%;height: 66px;"><h4>
															<b>任务团组名称:</b>
														</h4></td>
													<td colspan="3">
													      <input type="text" name="inter_missionName" style="width: 100%;height: 66px;"/>
													</td>
												</tr>
												<tr>
													<td style="width: 27%;height: 66px;" ><h4>
															<b>主办业务处室:</b>
														</h4></td>
													<td>
													      <input type="text" name="inter_business" style="width: 100%;height: 66px;" />
													</td>
													<td style="width: 12%;"><h4>
															<b>经办人：</b>
														</h4></td>
													<td>
													      <input type="text" name="inter_operator" style="width: 100%;height: 66px;"/>
													</td>
												</tr>
												<tr>
													<td><h4>
															<b>中介机构服务需求说明：</b>
														</h4></td>
													<td colspan="3" style="height: 190px;">
													    <textarea rows="12" cols="50" name="inter_specifications" style="width: 100%;"></textarea>							
													</td>
												</tr>
												<tr>
													<td style="width: 27%;height: 76px;"><h4>
															<b>电脑随机选取的承办机构：</b>
														</h4></td>
													<td style="width: 37%;height: 76px;">
													   <div style="display: inline;" id="oknum" name="oknum">*_*</div>
														  <br>
													      <br> 
													    <input type="button" accesskey="s" id="hl1"  value="开始随机" /> 
														<input type="button"  accesskey="o" id="hl2" onclick="return click_a('hl2')" value="停止" />
														<input type="hidden" id="k" name="inter_oknum">
													    
													</td>
													<td style="width: 12%;height: 86px;"><h4>
															<b>选取时间：</b>
														</h4></td>
													<td>
													   <div style="text-align: center;" id="validatevalue_s"></div>
													   <input type="hidden" id="validatevalue_i" name="inter_time" style="width: 220px;height: 76px; text-align: center;">
													</td>
												</tr>
												<tr>
													<td style="width: 27%;height: 66px;"><h4>
															<b>财务处：</b>
														</h4></td>
													<td><input type="text" name="inter_finance" style="width: 100%;height: 66px;"/></td>
													<td style="width: 12%;"><h4>
															<b>办公室：</b>
														</h4></td>
													<td><input type="text" name="inter_office" style="width: 100%;height: 66px;"/></td>
												</tr>
												<tr>
													<td><h4>
															<b>主办业务处室意见：</b>
														</h4></td>
													<td colspan="3" style="height: 190px;">
                                                    <textarea rows="12" cols="50" name="inter_idea" style="width: 100%;"></textarea>
                                                    </td>
												</tr>
											</table>
										</div>
										<br>
                                         <button type="submit" class="btn btn-lg btn-primary" style="margin-left: 43%;">预览打印</button>
                                          <button  type="reset" class="btn btn-lg btn-primary">重填</button>

									</form>
								</div>
							</div>

						</div>

					</div>
				</div>
				<!-- /FORMS -->
		
			</div>
			<!-- /CONTENT-->
		</div>
	</div>

</section>
<!--/PAGE -->







<!-- TYPEHEAD -->
<script type="text/javascript" src="js/typeahead/typeahead.min.js"></script>
<!-- AUTOSIZE -->
<script type="text/javascript" src="js/autosize/jquery.autosize.min.js"></script>
<!-- COUNTABLE -->
<script type="text/javascript"
	src="js/countable/jquery.simplyCountable.min.js"></script>
<!-- INPUT MASK -->
<script type="text/javascript"
	src="js/bootstrap-inputmask/bootstrap-inputmask.min.js"></script>
<!-- FILE UPLOAD -->
<script type="text/javascript"
	src="js/bootstrap-fileupload/bootstrap-fileupload.min.js"></script>
<!-- SELECT2 -->
<script type="text/javascript" src="js/select2/select2.min.js"></script>
<!-- UNIFORM -->
<script type="text/javascript" src="js/uniform/jquery.uniform.min.js"></script>
<!-- JQUERY UPLOAD -->
<!-- The Templates plugin is included to render the upload/download listings -->
<script src="js/blueimp/javascript-template/tmpl.min.js"></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="js/blueimp/javascript-loadimg/load-image.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="js/blueimp/javascript-canvas-to-blob/canvas-to-blob.min.js"></script>
<!-- blueimp Gallery script -->
<script src="js/blueimp/gallery/jquery.blueimp-gallery.min.js"></script>
<!-- The basic File Upload plugin -->
<script src="js/jquery-upload/js/jquery.fileupload.min.js"></script>
<!-- The File Upload processing plugin -->
<script src="js/jquery-upload/js/jquery.fileupload-process.min.js"></script>
<!-- The File Upload image preview & resize plugin -->
<script src="js/jquery-upload/js/jquery.fileupload-image.min.js"></script>
<!-- The File Upload audio preview plugin -->
<script src="js/jquery-upload/js/jquery.fileupload-audio.min.js"></script>
<!-- The File Upload video preview plugin -->
<script src="js/jquery-upload/js/jquery.fileupload-video.min.js"></script>
<!-- The File Upload validation plugin -->
<script src="js/jquery-upload/js/jquery.fileupload-validate.min.js"></script>
<!-- The File Upload user interface plugin -->
<script src="js/jquery-upload/js/jquery.fileupload-ui.min.js"></script>
<!-- The main application script -->
<script src="js/jquery-upload/js/main.js"></script>


<!--随机抽取  -->
<script type="text/javascript">
	$(document).ready(function() {
		var timer;
		var index = 0;
		var tempData = [];
		$("#hl1").on("click",function() {
			$.ajax({
				url : 'looks',
				dataType : 'json',
				async : 'true',
				type : 'post',
				success : function(data) {
					var newAr = [];
					for (var i in data) {
						newAr[i] = data[i].officeName;
					}
					tempData = newAr;
					var arr_leg = newAr.length;
					function change() {
						index = parseInt(Math.random() * (arr_leg - 1));
						index
						$("#oknum").text(newAr[index]);
					}
					function svh() {
						change();
						timer = setInterval(function() {
							change();
						}, 60);
					}
					svh();
					$("#oknum").text(newAr[index]);
					console.log(index);
				}
			});
		});
		$("#hl2").on("click",function() {
			//-----开始---获取当前时间
			var today = new Date();
			var year = today.getFullYear();
			var Month = today.getMonth() + 1;
			var day = today.getDate();
			var hour = today.getHours();
			var Minutes = today.getMinutes();
			var Second = today.getSeconds();
			strDate = year + "-" + Month + "-" + day + "  " + hour + ":" + Minutes + ":" + Second;
			$("#validatevalue_s").html(strDate);
			$("#validatevalue_i").val(strDate);
			//---------结束--------
			$("#k").val($("#oknum").html());
			console.log(tempData[index]);
			console.log(index);
			console.log(tempData);
			clearInterval(timer);
		});
	});
</script>
<!--开始按钮隐藏  -->
<script type="text/javascript">
	function Show_Hidden(obj) {
		obj.style.display = 'none';

	}
	window.onload = function() {
		var olink = document.getElementById("hl1");
		olink.onclick = function() {
			Show_Hidden(olink);
			return false;
		}
	}
</script>
<!-- 结束按钮隐藏 -->
<script language="javascript" type="text/javascript">
	function click_a(divDisplay) {
		if (document.getElementById(divDisplay).style.display = "block") {
			document.getElementById(divDisplay).style.display = "none";

		} else {
			document.getElementById(divDisplay).style.display = "block";
		}
	}
</script>

<script>
	jQuery(document).ready(function() {
		App.setPage("intermediarySave"); //Set current page
		App.init(); //Initialise plugins and elements



	});
</script>



<!-- /JAVASCRIPTS -->

